$(document).ready(function(){
    var pos = 1;
    $("#cartIcon").click(function(){
        if(pos == 1){
            $("#sidebar .list-group").animate({right: 200,opacity: 'toggle'},1000);
            pos = 0;
        }else{
            $("#sidebar .list-group").animate({right: 400,opacity: 'toggle'},1000);
            pos = 1;
        }
    }).mouseover(function(){
        $(this).animate({right: '0px'}, "slow",function(){
            $("#left").css("background","#1e89e0 url('images/right.png')");
        });
    }).mouseleave(function(){
        $(this).animate({right: '-80px'}, "slow",function(){
            $("#left").css("background","#1e89e0 url('images/left.png')");
        });
    });
});
